
<!--
/**************************************************
* @ providerdetail.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/03/01, owen
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../common.jsp" %>

<html>
<head>
<title>产品增加</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/css.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/hi-check.js"></SCRIPT>

<%
	ArrayList tManuf1 = (ArrayList)request.getAttribute("manufacture1");
	//ArrayList tManuf2 = (ArrayList)request.getAttribute("manufacture2");
	//ArrayList tManuf3 = (ArrayList)request.getAttribute("manufacture3");	
	//HashMap tMap1 = new HashMap();
	//HashMap tMap2 = new HashMap();
	HashMap tMap1 = (HashMap)request.getAttribute("manufacturetyp2");
	if(tMap1 != null){
	    System.out.println(""+tMap1.size());
	}else{
	    System.out.println("false");
	}
	HashMap tMap2 = (HashMap)request.getAttribute("manufacturetyp3");
	if(tMap2 != null){
	    System.out.println(""+tMap2.size());
	}else{
	    System.out.println("false");
	}
	    
	//ResultProcess tGSManuf = (ResultProcess)request.getAttribute("manufacture");
%>
<script language="JavaScript">
	var counter;
	function check(){
	     var iFields1 = new Array(4);
        iFields1[0] = 'gs_manufacture_id||产品编号||Y||1-20||#0';
        iFields1[1] = 'gs_manufacture_name||产品名称||Y||1-50||##';
        iFields1[2] = 'gs_manufacture_unitprice||产品单价||Y||1-21||#0';
        iFields1[3] = 'gs_quant_unit||数量单位||Y||1-20||##';
       
		if( HiScript.value(checkform.name,iFields1) == false)  return false;
	    
	
		 checkform.action="<%= response.encodeURL(request.getContextPath() + "/A400304.do") %>";   
	     document.checkform.submit();
	}
    
    function back(){
		 checkform.action="<%= response.encodeURL(request.getContextPath() + "/A400301.do") %>";   
	     document.checkform.submit();
	}
	
	function selectprovider(){
		var url = "<%= response.encodeURL(request.getContextPath() + "/A100106.do") %>";
		var returnv = window.open(url,null," edge: sunken ; center: Yes; help: No; resizable: No; status: Yes; dialogWidth: 840px ; dialogHeight: 720px ; scroll:yes");
		
	}
	
	function change1(optval){
  		var val = optval;
		if(val=='0'){
			var listbox = document.getElementById("manuftype2");
			listbox.length = 0;
			var option = new Option();
			option.text = "---二级---";
			option.value = "0";			
			listbox.options[listbox.length] = option;

		}else{
  	<%
  		if(tMap1 !=null){
	 	   	Collection tCollection = tMap1.keySet();
	        Iterator tIterator = tCollection.iterator();
  		       while(tIterator.hasNext()){
  		           String tKey = (String)tIterator.next();
  		           ArrayList tList = (ArrayList)tMap1.get(tKey);
  	%>
  				if(val == '<%=tKey%>'){
	  				var counter;
	  				var listbox = document.getElementById("manuftype2");
	  				listbox.length = 0;  		  	  	
							var option = new Option();
							option.value = "0";
							option.text = "---二级---";
							listbox.options[listbox.length] = option;			  											
	<%					
						for(int n=0;n<tList.size();n++){
						    GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList.get(n);
						    String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
						    String categoryName = tGSManufactureBean.getGs_manufacture_category_name();
	%>				
							var temp1 = '<%=categoryId%>';
							var temp2 = '<%=categoryName%>';
							var option = new Option();
							option.value = temp1;
							option.text = temp2;
							listbox.options[listbox.length] = option;						
	<%
						}
	%>
  				}
  	<%
  		    }
  		       
  		}
  	%>
  	}	
	}	
	function change2(optval){
  		var val = optval;
		if(val=='0'){
			var listbox = document.getElementById("manuftype3");
			listbox.length = 0;
			var option = new Option();
			option.text = "---三级---";
			option.value = "0";			
			listbox.options[listbox.length] = option;

		}else{
  	<%
  		if(tMap2 !=null){
	 	   	Collection tCollection = tMap2.keySet();
	        Iterator tIterator = tCollection.iterator();
  		       while(tIterator.hasNext()){
  		           String tKey = (String)tIterator.next();
  		           ArrayList tList = (ArrayList)tMap2.get(tKey);
  	%>
  				if(val == '<%=tKey%>'){
	  				var counter;
	  				var listbox = document.getElementById("manuftype3");
	  				listbox.length = 0;  		  	  	
			var option = new Option();
			option.text = "---三级---";
			option.value = "0";			
			listbox.options[listbox.length] = option;	  											
	<%					
						for(int n=0;n<tList.size();n++){
						    GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList.get(n);
						    String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
						    String categoryName = tGSManufactureBean.getGs_manufacture_category_name();
	%>				
							var temp1 = '<%=categoryId%>';
							var temp2 = '<%=categoryName%>';
							var option = new Option();
							option.value = temp1;
							option.text = temp2;
							listbox.options[listbox.length] = option;						
	<%
						}
	%>
  				}
  	<%
  		    }
  		       
  		}
  	%>
  	}		
	}
	function openwin(value){
		showModalDialog("<%= response.encodeURL(request.getContextPath() + "/jsp/showimage.jsp") %>?path=" + value,window,"status:no;unadorned:yes;dialogWidth:375px;dialogHeight:400px;help:no;");
	}
</script>
</head>
<body BGCOLOR="#f2f2f2"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="checkform" action="<%= response.encodeURL(request.getContextPath() + "/A400304.do") %>" method="post">
<p><br></p>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td height="20">
		<table width="100%" border="0" cellspacing="0" cellpadding="1">
			<tr height="20">
				<td height="20" width="1" class="mtxt_black">&nbsp;</td>
				<td height="30" width="758" class="mtxt_black">新增产品信息</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td class="bg_line" height="2"></td>
	</tr>
</table>
<br>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_row_odd" align=center width="20%">产品编号</TD>
					<TD align=left class="bg_row_odd" width="30%">
					<input type=text name="gs_manufacture_id" maxlength="20" size=30/>
					</TD>					
					<TD class="bg_row_odd" align=center width="20%">产品名称</TD>
					<TD align=left class="bg_row_odd" width="30%">
					<input type=text name="gs_manufacture_name" maxlength="50" size=30/>
					</TD>					
				</TR>
				<TR height=20>
					<TD class="bg_row_odd" align=center width="20%">集中编码</TD>
					<TD align=left class="bg_row_odd" width="30%">
					<input type=text name="gs_concentricity" maxlength="10" size=30/>
					</TD>					
					<TD class="bg_row_odd" align=center width="20%">产品品牌</TD>
					<TD align=left class="bg_row_odd" width="30%">
					<input type=text name="gs_manufacture_brand" maxlength="50" size=30/>
					</TD>					
				</TR>
				<TR height=20>
					<TD class="bg_row_odd" align=center>产品种类</TD>
					<TD align=left class="bg_row_odd" colspan="3">
					<select name="manuftype1" onChange="change1(this.value)">	
						<option value="0">---一级---</option>				
						<%
							String tManufType1 = request.getParameter("manuftype1");
							//int iManuType1 = 0;
							if(tManuf1 != null && tManuf1.size() > 0 ){
							    if(tManufType1 != null){
							        //iManuType1 = Integer.parseInt(tManufType1);
							    }
								for(int i=0; i<tManuf1.size(); i++){
								    GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tManuf1.get(i);
								    %>
								    <option value="<%=tGSManufactureBean.getGs_manufacture_category_id()%>">
				                       <%=tGSManufactureBean.getGs_manufacture_category_name()%>
				                    </option>
						<%				
								}
							}
						%>

						</select>
						<select id="manuftype2" name="manuftype2" onChange="change2(this.value)">	
						<option value="0">---二级---</option>				
						<%
							String tManufType2 = request.getParameter("manuftype2");
							if(tManufType1 != null && !tManufType1.equals("0")){
							    //int tIntManuType2 = Integer.parseInt(tManufType2);
							    ArrayList temp = (ArrayList)tMap1.get(tManufType1);
							    if(temp!= null && temp.size() > 0){
									for(int i=0; i<temp.size(); i++){
									    GSManufactureCategoryBean tGSManuf2 = (GSManufactureCategoryBean)temp.get(i);
						%>
								
									<option value="<%=tGSManuf2.getGs_manufacture_category_id()%>">
									   <%=tGSManuf2.getGs_manufacture_category_name()%>
									</option>
									
							<%				
									}
							    }
							}
						%>

						</select>
						<select name="manuftype3" id="manuftype3">	
						<option value="0">---三级---</option>				
						<%
							String tManufType3 = request.getParameter("manuftype3");
							if(tManufType2 != null && !tManufType2.equals("0") ){
							    //int tIntManufType3 = Integer.parseInt(tManufType3);
							    ArrayList temp = (ArrayList)tMap2.get(tManufType2);
							    if(temp != null && temp.size() > 0){
									for(int i=0; i<temp.size(); i++){
									    GSManufactureCategoryBean tGSManuf3 = (GSManufactureCategoryBean)temp.get(i);
							%>
									<option value="<%=tGSManuf3.getGs_manufacture_category_id()%>">
									  <%=tGSManuf3.getGs_manufacture_category_name()%>
									</option>
									
							<%				
									}
							    }
							}
						%>

						</select>
					</TD>									
					
				</TR>
				<tr>
					<TD class="bg_row_odd" align=center>产品型号</TD>
					<TD left=right class="bg_row_odd" >
				     <input type=text name="gs_manufacture_type" maxlength="100" size=30/>
					</TD>					
					<TD class="bg_row_odd" align=center>产品规格</TD>
					<TD left=right class="bg_row_odd">
					<input type=text name="gs_manufacture_spec" maxlength="100" size=30/>
					</TD>					
				</TR>
				<TR height=20>
					<TD class="bg_row_odd" align=center>产品单价</TD>
					<TD left=right class="bg_row_odd">
					<input type=text name="gs_manufacture_unitprice" maxlength="100" size=30/>
					</TD>					
					<TD class="bg_row_odd" align=center>数量单位</TD>
					<TD left=right class="bg_row_odd">
					<input type=text name="gs_quant_unit" maxlength="100" size=30/>
					</TD>					
				</TR>				
				<TR height=20>
					<TD class="bg_row_odd" align=center>质保期</TD>
					<TD left=right class="bg_row_odd">
					<input type=text name="gs_quality_assure_period" maxlength="100" size=30/>
					</TD>					
					<TD class="bg_row_odd" align=center>生产厂商</TD>
					<TD left=right class="bg_row_odd">
					<input type=text name="gs_manufacturer_name" maxlength="100" size=30/>
					</TD>					
				</TR>				
				<TR height=20>
					<TD class="bg_row_odd" align=center>产地</TD>
					<TD left=right class="bg_row_odd">
					<input type=text name="gs_make_area" maxlength="100" size=30/>
					</TD>					
					<TD class="bg_row_odd" align=center>供应商</TD>
					<TD left=right class="bg_row_odd">
					<input type="text" size=15 id='provider_name' name="gs_provider_name" value="">&nbsp;
					<input type="hidden" id='provider_id' name="gs_provider_id" value="">&nbsp;
					<input type='button' value='选择...' onclick='selectprovider();'>
					</TD>					
				</TR>				
				<TR height=20>
					<TD class="bg_row_odd" align=center>适用机型</TD>
					<TD left=right class="bg_row_odd">
					<input type=text name="gs_adapt_machine_type" maxlength="100" size=30/>
					</TD>					
					<TD class="bg_row_odd" align=center>产品图片</TD>
					<TD left=right class="bg_row_odd">
										
					</TD>					
				</TR>				
																		
			</table>
		</td>
	</tr>
</table>
</form>
    <p align="center">  
		<input type="image" src="<%=root%>/images/button/zengjia.gif" width="58" height="24" class="box" onclick="return check();"> 
		<input type="image" src="images/button/fanhui.gif" width="58" height="24" class="box" onclick="return back();"/>&nbsp;		
    </p>
</body>
</html>